#ifndef __TOOLKIT_H__
#define __TOOLKIT_H__

#include <QString>
#include <QHostAddress>
#include <QByteArray>

class TK
{
public:
    static const char* hextab;
    
    static const char* socketTypeName(bool tcp);
    static QString ipstr(const QHostAddress& addr, quint16 port);
    static QString bin2hex(const char* buf, uint len);
    static QString bin2ascii(const char* buf, uint len);
    static bool ascii2bin(const QString& src, QByteArray& dst, QString& err);
    
    static char* createBuffer(qint64& cap, qint64 limit);
    static void releaseBuffer(char*& buf);
};

#endif // __TOOLKIT_H__ 